package com.f21.f21assessoria.converter;

import javax.faces.component.UIComponent;
import javax.faces.context.FacesContext;
import javax.faces.convert.FacesConverter;

import com.f21.f21assessoria.enums.Perfis;

//@FacesConverter(forClass = Perfis.class)
@FacesConverter(value="PerfilConverter")
public class ConverterPerfis extends TemplateConverterEnum {

	@Override
	public Object getAsObject(FacesContext context, UIComponent component,
			String value) {

		for (Perfis p : Perfis.values()) {
			if (p.getLabel().equalsIgnoreCase(value))
				return p;
		}

		return null;

	}

}
